package com.coderknock.spring.boot.elasticsearch.repository;

import com.coderknock.spring.boot.elasticsearch.model.Product;
//import org.springframework.data.elasticsearch.annotations.Query;
//import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * <p></p>
 *
 * @author 三产
 * @version 1.0
 * @date 2017-07-03
 * @QQGroup 213732117
 * @website http://www.coderknock.com
 * @copyright Copyright 2017 拿客 coderknock.com  All rights reserved.
 * @since JDK 1.8
 */
//操作 Product 类的仓库接口
    public interface ProductRepository
        //extends CrudRepository<Product, Long>
{
    //@Query("{\"bool\" : {\"should\" : [{\"term\" : {\"name\" : \"?0\"}},{\"term\" : {\"description\" : \"?0\"}}]}}}")
    List<Product> findByNameOrDescription(String query);
}